﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Office.Tools.Ribbon;
using Microsoft.Office.Interop.Excel;

namespace ExcelVSTOHello {
    public partial class HelloRibbon {
        private Application excelApp = null;

        private void HelloRibbon_Load(object sender, RibbonUIEventArgs e) {
            excelApp = Globals.ThisAddIn.Application;
        }

        private void btnMessage_Click(object sender, RibbonControlEventArgs e) {
            Range currentCell = excelApp.ActiveCell;
            currentCell.Value = "Hello World";
        }
    }
}
